package idv.arthur.widgets;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class StringIdx {

	public static void main(String[] args) throws SQLException, ClassNotFoundException {
		Class.forName("com.mysql.jdbc.Driver");
		final String tarIp = "10.144.136.54";
		final int tarPort = 3306;
		final String tarDBname = "shield";
		final String url = "jdbc:mysql://"+tarIp+":"+tarPort+"/"+tarDBname;
		
		String sql = "SELECT depResult FROM fdepdetail WHERE depmainSN=86 and fdepdetailid=4";
		
		Connection conn = DriverManager.getConnection( url,"Arthur","abcd1234" );
		PreparedStatement ps = conn.prepareStatement(sql);
		ResultSet rs = ps.executeQuery();
		rs.next();
		
		String t = rs.getString(1);
		System.out.println(t.indexOf("{\n    \"outcome\" => \"success\""));
		
		rs.close();
		ps.close();
		conn.close();
	}

}
